package com.jsoft.service;

import com.jsoft.dto.ServiceDto;
import com.jsoft.manager.ServicesManager;
import com.jsoft.model.ServiceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Date: 08.09.13
 * Time: 11:29
 */

@Service
public class ServicesServiceImpl implements ServicesService {
    @Autowired
    private ServicesManager servicesManager;

    @Override
    public List<ServiceDto> getList() {
        List<ServiceDao> serviceDaoList = servicesManager.getAllList();
        List<ServiceDto> serviceDtoList = new ArrayList<ServiceDto>();
        for (ServiceDao dao : serviceDaoList) {
            serviceDtoList.add(dao.wrapServiceDto());
        }
        return serviceDtoList;
    }
}
